package com.tingyukeji.fastpay.collection.activity;

import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.view.View;

import com.tingyukeji.fastpay.R;
import com.tingyukeji.fastpay.base.BaseActivity;
import com.tingyukeji.fastpay.collection.adapter.BillAdapter;
import com.tingyukeji.fastpay.databinding.CollectionBillActivityBinding;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016/11/11.
 */

public class CollectionBillActivity extends BaseActivity implements View.OnClickListener {
    private CollectionBillActivityBinding binding;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    protected void setContentView() {
        super.setContentView();
        binding = DataBindingUtil.setContentView(this, R.layout.collection_bill_activity);
    }

    @Override
    protected void initView() {
        super.initView();
        initBillList();
    }

    private void initBillList() {
        List<Integer> commList = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            commList.add(i);
        }
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
        binding.billRecyclerview.setLayoutManager(linearLayoutManager); //给RecyClerView 添加设置好的布局样式
        BillAdapter billAdapter = new BillAdapter(commList,context,false); //初始化适配器
        binding.billRecyclerview.setAdapter(billAdapter); // 对 recyclerview 添加数据内容

    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.bt_next:
//                handleLoginUi(LOGIN_TAG);
//                if (null == loginFragment) {
//                    loginFragment = new LoginFragment();
//                    transaction.add(R.id.fl_showfragment, loginFragment);
//                    loginFragment.setFocusCallBaskListener(mFocusCallBaskListener);
//                } else
//                    transaction.show(loginFragment);
                break;
        }
    }

}
